<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>系统管理总后台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.4 -->
    <link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- FontAwesome 4.3.0 -->
    <link href="__PUBLIC__/bootstrap/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Ionicons 2.0.0 --
    <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <!-- <link href="__PUBLIC__/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" /> -->
    <!-- AdminLTE Skins. Choose a skin from the css/skins
        folder instead of downloading all of them to reduce the load. -->
    <link href="__PUBLIC__/dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="__PUBLIC__/plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
    <!-- jQuery 2.1.4 -->
    <script src="__PUBLIC__/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <script src="__PUBLIC__/js/global.js"></script>
    <script src="__PUBLIC__/js/myFormValidate.js"></script>
    <script src="__PUBLIC__/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/layer/layer-min.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->
    <script src="__PUBLIC__/js/myAjax.js"></script>
    <script type="text/javascript">
        function delfunc(obj){
            layer.confirm('确认删除？', {
                        btn: ['确定','取消'] //按钮
                    }, function(){
                        $.ajax({
                            type : 'post',
                            url : $(obj).attr('data-url'),
                            data : {act:'del',del_id:$(obj).attr('data-id')},
                            dataType : 'json',
                            success : function(data){
                                if(data==1){
                                    layer.msg('操作成功', {icon: 1});
                                    $(obj).parent().parent().remove();
                                }else{
                                    layer.msg(data, {icon: 2,time: 2000});
                                }
                                layer.closeAll();
                            }
                        })
                    }, function(index){
                        layer.close(index);
                        return false;// 取消
                    }
            );
        }

        //全选
        function selectAll(name,obj){
            $('input[name*='+name+']').prop('checked', $(obj).checked);
        }

        function get_help(obj){
            layer.open({
                type: 2,
                title: '帮助手册',
                shadeClose: true,
                shade: 0.3,
                area: ['90%', '90%'],
                content: $(obj).attr('data-url'),
            });
        }

        function delAll(obj,name){
            var a = [];
            $('input[name*='+name+']').each(function(i,o){
                if($(o).is(':checked')){
                    a.push($(o).val());
                }
            })
            if(a.length == 0){
                layer.alert('请选择删除项', {icon: 2});
                return;
            }
            layer.confirm('确认删除？', {btn: ['确定','取消'] }, function(){
                        $.ajax({
                            type : 'get',
                            url : $(obj).attr('data-url'),
                            data : {act:'del',del_id:a},
                            dataType : 'json',
                            success : function(data){
                                if(data == 1){
                                    layer.msg('操作成功', {icon: 1});
                                    $('input[name*='+name+']').each(function(i,o){
                                        if($(o).is(':checked')){
                                            $(o).parent().parent().remove();
                                        }
                                    })
                                }else{
                                    layer.msg(data, {icon: 2,time: 2000});
                                }
                                layer.closeAll();
                            }
                        })
                    }, function(index){
                        layer.close(index);
                        return false;// 取消
                    }
            );
        }
    </script>
</head>
<body style="background-color:#ecf0f5;">


<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/qrcode.min.js"></script>
<link type="text/css" rel='stylesheet' href="__PUBLIC__/css/style.css" />

<style>
    /*框架主体分隔间购*/
    .main {background-color: #F0F0F0;overflow-x: scroll;border: 0px solid #dedede;padding-top: 15px;padding-right: 15px;padding-bottom: 18px;padding-left: 15px;}
    ul,li{padding:0px;margin:0px;}
    li{list-style:none;}
    .box{
        width:100%;
        height:180px;
        /*border:1px solid red;*/
        margin:0 auto;
    }
    .box ul{
        background:#ddd;
        position: relative;
        float:left;
    }
    .box .tab1{
        width:150px;
        height:150px;
        margin:0 460px;
    }
    .box .tab2{width:150px;height:150px;margin-left:205px;margin-right:156px;}
    .box .tab3{width:150px;height:150px;margin-left:59px;margin-right:56px;}
    .box .tab4{width:131px;height:150px;margin-left:2px;}
    .box .line{width:100%;height:30px;float:left;}

    .line .x1{margin:0 auto;width:48%;height:2px;background:blue;}
    .line .y{width:2px;height:14px;float:left;background:blue;}
    .line .y1{margin:0 auto;width:2px;height:14px;background:blue;}
    .line .y2{margin-left:277px;margin-right:232px;}
    .line .x2{margin:0 auto;width:25%;height:2px;background:blue;float:left;margin-left:131px;margin-right:134px;}
    .line .y3{width:2px;height:14px;background:blue;margin-left:277px;margin-right:230px;float:left;}
    .line .y4{margin-left:131px;margin-right:132px;}
    .line .x3{margin:0 auto;width:13%;height:2px;background:blue;float:left;margin-left:65px;margin-right:61px;}
    .line .y5{width:2px;height:14px;background:blue;margin-left:131px;margin-right:133px;float:left;}
    .line .y6{margin-left:64px;margin-right:67px;}
    .box ul li{float:left;width:45%;height:20px;line-height:20px;margin-left:4px;}
    .box ul li span{color:red;font-size:12px;}
    .box ul p{float:left;width:2px;height:20px;line-height:20px;background:blue;}
    .prev{width:25px;height:40px;position:absolute;right:0px;top:0px;line-height:40px;text-align:center;font-size:16px;font-weight:bold;color:#fff;background:green;cursor:pointer;}
    .next{width:20px;height:20px;border:1px solid green;position:absolute;right:0px;bottom:0px;font-weight:bold;color:#fff;background:purple;cursor:pointer;line-height:20px;text-align:center;font-size:15px;}
</style>
<body class="gray-bg"  style="background:#fff;">
<div class="wrapper wrapper-content animated fadeInRight" >
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content" style="background:#fff;">
                    <div class="row">
                        <div class="col-sm-4 m-b-xs">
                            <div data-toggle="buttons" class="btn-group">
                                <li>会员帐号：<b class="text_red_line">{$list.account}</b>&nbsp;&nbsp;&nbsp;团队：<b class="text_red_line">{$old.td_man}</b> 人&nbsp;&nbsp;&nbsp;左区：<b class="text_red_line"> {$old.l_man}</b> 人&nbsp;&nbsp;&nbsp;右区：<b class="text_red_line"> {$old.r_man}</b> 人&nbsp;&nbsp;&nbsp;直推：<b class="text_red_line"> {$old.zt_man}</b> 人&nbsp;&nbsp;&nbsp;左区总业绩：<b class="text_red_line"> {$list.left_total}</b>&nbsp;&nbsp;&nbsp;右区总业绩：<b class="text_red_line"> {$list.right_total}</b></li>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <form  method="get" action="__CONTROLLER__/arrangefor"  target="_self">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入会员账号" name="user"  class="input-sm form-control"> <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                </div>
                                <input type="hidden" name="user_id" value="{$user2_id}"/>
                            </form>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <div class="formbody" style="width:1098px;margin:0 auto;background:#fff;">
                            <div class="clr"></div>

                            <div class="main" style="background:#fff;">
                                <div class="box b1">
                                    <ul class="tab1 t10" > </ul>
                                    <div class="line">
                                        <p class="y1"></p><hr class="x1" /><p class="y y2"></p><p class="y y2 tz1"></p>
                                    </div>
                                </div>

                                <div class="box b2">
                                    <ul class="tab2 t20"></ul>
                                    <ul class="tab2 t21 tz1"></ul>

                                    <div class="line">
                                        <p class="y3"></p><p class="y3 tz2"></p>
                                        <hr class="x2" /><hr class="x2 tz3" />
                                        <p class="y y4"></p><p class="y y4"></p>
                                        <p class="y y4 tz4" style="margin-left:133px;"></p><p class="y y4 tz5"></p>
                                    </div>
                                </div>


                                <div class="box b3">
                                    <ul class="tab3 t40"></ul>
                                    <ul class="tab3 t41"></ul>
                                    <ul class="tab3 t42 tz2" style="margin-left:61px;"></ul>
                                    <ul class="tab3 t43"></ul>

                                    <!--<div class="line">
                                        <p class="y5"></p><p class="y5"></p><p class="y5"></p><p class="y5"></p>
                                        <hr class="x3" /><hr class="x3" /><hr class="x3" /><hr class="x3" />
                                        <p class="y y6"></p><p class="y y6"></p><p class="y y6"></p><p class="y y6"></p>
                                        <p class="y y6"></p><p class="y y6"></p><p class="y y6"></p><p class="y y6"></p>
                                    </div>-->
                                </div>

                                <!--<div class="box b4">
                                    <ul class="tab4 t80"> </ul>
                                    <ul class="tab4 t81"></ul>
                                    <ul class="tab4 t82"></ul>
                                    <ul class="tab4 t83"></ul>
                                    <ul class="tab4 t84"></ul>
                                    <ul class="tab4 t85"></ul>
                                    <ul class="tab4 t86"> </ul>
                                    <ul class="tab4 t87"></ul>
                                </div>-->
                            </div>
                        </div>
                        <script>
                            if ($('.t10').html() == false) {
                                var account = $('input[name="user_id"]').val();
                                $.get('__CONTROLLER__/network', {user: account}, function (data) {
                                    var obj = eval(data);
                                    console.log(data);
                                    $('.box ul').html('');
                                    for (var i in obj) {
                                        if (obj[i].username == null) {
                                            obj[i].username = '';
                                        }
                                        if (obj[i].jhtime == null) {
                                            obj[i].jhtime = '';
                                        }

                                        var tab = '<li><b></b><span>' + obj[i].account + '</span><div class="prev">上</div></li><p></p><li><b></b><span>' + obj[i].username + '</span></li><li><b></b><span>' + obj[i].grade_id + '</span></li><p></p><li><b></b><span>' + obj[i].activate + '</span></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li style="width:100%;background:red;height:2px;border:none;margin-top:5px;margin-left:0px"></li><li><center><b>左区</b></center></li><p></p><li><center><b>右区</b></center></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li><b>总:</b><span>' + obj[i].left_total + '</span></li><p></p><li><b></b><span>' + obj[i].right_total + '</span></li><li><b>结:</b><span>' + obj[i].prev_knot + '</span></li><p></p><li><b></b><span>' + obj[i].prev_knot + '</span></li><li><b>余:</b><span>' + obj[i].left_new + '</span></li><p></p><li><b></b><span>' + obj[i].right_new + '</span></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li style="width:95%;margin:0px 2px;" class="down"><span>' + obj[i].jhtime + '</span></li><div class="next">下</div>';
                                        $('.t' + i).html(tab);
                                    }

                                    $('.box ul').each(function () {
                                        if ($(this).html() == '') {
                                            var cn = $(this).attr('class');
                                            var num = cn.substr(6, 2);
                                            var nex = 0;
                                            if (num % 2 == 0) {
                                                nex = num + 1;
                                            } else {
                                                nex = num - 1;
                                            }

                                            var clas3 = '.t' + Math.floor(num / 2);
                                            var pre = $(clas3).first().find('span').html();
                                            var reg = '<a href="#" style="display:none">' + pre + '</a><h2 class="register" style="font-size:18px;font-weight:bold;background:purple;color:#fff;text-align:center;cursor:pointer;">注册会员</h2>'

                                            if ($(clas3).html() != '' && $(clas3).html().substr(0, 2) != '<a') {

                                                $(this).html(reg);

                                            } else {
                                                $(this).html('');
                                                $('.t' + nex).html('');
                                            }


                                        }
                                    });
                                });

                            }

                            $('.next').live('click', function () {

                                var account = $(this).parent().first().find('span').html();

                                $.get('__CONTROLLER__/network', {user: account}, function (data) {
                                    var obj = eval(data);
                                    $('.box ul').html('');
                                    for (var i in obj) {
                                        if (obj[i].username == null) {
                                            obj[i].username = '';
                                        }
                                        if (obj[i].jhtime == null) {
                                            obj[i].jhtime = '';
                                        }
                                        var tab = '<li><b></b><span>' + obj[i].account + '</span><div class="prev">上</div></li><p></p><li><b></b><span>' + obj[i].username + '</span></li><li><b></b><span>' + obj[i].grade_id + '</span></li><p></p><li><b></b><span>' + obj[i].activate + '</span></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li style="width:100%;background:red;height:2px;border:none;margin-top:5px;margin-left:0px"></li><li><center><b>左区</b></center></li><p></p><li><center><b>右区</b></center></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li><b>总:</b><span>' + obj[i].left_total + '</span></li><p></p><li><b></b><span>' + obj[i].right_total + '</span></li><li><b>结:</b><span>' + obj[i].prev_knot + '</span></li><p></p><li><b></b><span>' + obj[i].prev_knot + '</span></li><li><b>余:</b><span>' + obj[i].left_new + '</span></li><p></p><li><b></b><span>' + obj[i].right_new + '</span></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li style="width:95%;margin:0px 2px;" class="down"><span>' + obj[i].jhtime + '</span></li><div class="next">下</div>';
                                        $('.t' + i).html(tab);
                                    }

                                    $('.box ul').each(function () {
                                        if ($(this).html() == '') {
                                            var cn = $(this).attr('class');
                                            var num = cn.substr(6, 2);
                                            var nex = 0;
                                            if (num % 2 == 0) {
                                                nex = num + 1;
                                            } else {
                                                nex = num - 1;
                                            }

                                            var clas3 = '.t' + Math.floor(num / 2);
                                            var pre = $(clas3).first().find('span').html();
                                            var reg = '<a href="#" style="display:none">' + pre + '</a><h2 class="register" style="font-size:18px;font-weight:bold;background:purple;color:#fff;text-align:center;cursor:pointer;">注册会员</h2>'

                                            if ($(clas3).html() != '' && $(clas3).html().substr(0, 2) != '<a') {
                                                if (num % 2 == 0) {
                                                    $('.t' + num - 1).html('');
                                                    $(this).html(reg);
                                                } else {
                                                    if ($('.t' + nex).html() != '' && $('.t' + nex).html().substr(0, 2) != '<a') {
                                                        $(this).html(reg);

                                                    } else {
                                                        $(this).html('');
                                                    }
                                                }

                                            } else {
                                                $(this).html('');
                                                $('.t' + nex).html('');
                                            }
                                        }
                                    });
                                });

                            });

                            $('.prev').live('click', function () {

                                var account = $(this).prev('span').html();
                                if (account != {$firstuser.account}) {
                                    $.get('__CONTROLLER__/yyy', {use: account}, function (data) {
                                        var obj = eval(data);
                                        $('.box ul').html('');
                                        for (var i in obj) {
                                            if (obj[i].username == null) {
                                                obj[i].username = '';
                                            }
                                            if (obj[i].jhtime == null) {
                                                obj[i].jhtime = '';
                                            }
                                            var tab = '<li><b></b><span>' + obj[i].account + '</span><div class="prev">上</div></li><p></p><li><b></b><span>' + obj[i].username + '</span></li><li><b></b><span>' + obj[i].grade_id + '</span></li><p></p><li><b></b><span>' + obj[i].activate + '</span></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li style="width:100%;background:red;height:2px;border:none;margin-top:5px;margin-left:0px"></li><li><center><b>左区</b></center></li><p></p><li><center><b>右区</b></center></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li><b>总:</b><span>' + obj[i].left_total + '</span></li><p></p><li><b></b><span>' + obj[i].right_total + '</span></li><li><b>结:</b><span>' + obj[i].prev_knot + '</span></li><p></p><li><b></b><span>' + obj[i].prev_knot + '</span></li><li><b>余:</b><span>' + obj[i].left_new + '</span></li><p></p><li><b></b><span>' + obj[i].right_new + '</span></li><li style="width:100%;background:blue;height:1px;border:none;margin:0px;"></li><li style="width:95%;margin:0px 2px;" class="down"><span>' + obj[i].jhtime + '</span></li><div class="next">下</div>';
                                            $('.t' + i).html(tab);

                                        }

                                        $('.box ul').each(function () {
                                            if ($(this).html() == '') {
                                                var cn = $(this).attr('class');
                                                var num = cn.substr(6, 2);
                                                var nex = 0;
                                                if (num % 2 == 0) {
                                                    nex = num + 1;
                                                } else {
                                                    nex = num - 1;
                                                }

                                                var clas3 = '.t' + Math.floor(num / 2);
                                                var pre = $(clas3).first().find('span').html();
                                                var reg = '<a href="#" style="display:none">' + pre + '</a><h2 class="register" style="font-size:18px;font-weight:bold;background:purple;color:#fff;text-align:center;cursor:pointer;">注册会员</h2>'

                                                if ($(clas3).html() != '' && $(clas3).html().substr(0, 2) != '<a') {
                                                    if (num % 2 == 0) {
                                                        $('.t' + num - 1).html('');
                                                        $(this).html(reg);
                                                    } else {
                                                        if ($('.t' + nex).html() != '' && $('.t' + nex).html().substr(0, 2) != '<a') {
                                                            $(this).html(reg);

                                                        } else {
                                                            $(this).html('');
                                                        }
                                                    }
                                                } else {
                                                    $(this).html('');
                                                    $('.t' + nex).html('');
                                                }

                                            }
                                        });
                                    });
                                }

                            });

                            $('.register').live('click', function () {
                                var jdr = $(this).prev('a').html();
                                var cn = $(this).parent().attr('class');
                                var num = cn.substr(6, 2);
                                var sb = 0;
                                if (num % 2 == 0) {
                                    sb = 1;
                                } else {
                                    sb = 2;
                                }

                                window.location.href = '__MODULE__/User/add_user?accname=zf888&jdr=' + jdr + '&sb=' + sb;
                            });

                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
